#pragma once

#ifndef Parser_h
#define Parser_h

#include "PKB.h"
#include "Standards.h"

using namespace std;

class Parser {
	public:
		PKB* myPKB;
		Parser(PKB*);
		void startParsing(string);
		void validateNAME(string);
		bool checkNAME(string);

	private:
		INDEX globalStmtCounter;
		INDEX currProcIndex;
		vector<string> SpaceRemoval(vector<string>,string);
		vector<string> SpaceRemovalSemiColon(vector<string>);
		vector<string> BracketSpacer(vector<string>,string);

		bool match(string,string);
		void validateNAMEINTEGER(string);
		bool check(string,string);
		bool hasEndsWith(string,char);

		int Procedure(int i,vector<string>);
		int StmtLst(int i,vector<string>,bool, bool, INDEX);
		int Stmt(int i,vector<string>,INDEX,INDEX*);
		int PWhile(int i,vector<string>,INDEX);
		int PIf(int i,vector<string>,INDEX);
		int Call(int i,vector<string>,INDEX);
		int Assign(int i,vector<string>,INDEX, INDEX*);
};
#endif